<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head itemscope itemtype="http://schema.org/WebSite">
  <!-- meta -->
  <meta charset="utf-8"/>
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  <meta name="referrer" content="always"/>
  <meta property="qc:admins" content="345615513542636" />
  <meta name="apple-itunes-app" content="app-id=1082195150"/>
  <meta property="og:type" content="bbs"/>
  <link rel="dns-prefetch" href="//hm.baidu.com"/>
  <link rel="dns-prefetch" href="//s95.cnzz.com"/>
  <!--#if (cdnbase != null && cdnbase != ""){ #-->
  <link rel="dns-prefetch" href="${cdnbase}"/>
  <!--#} #-->
  <link title="RSS" type="application/rss+xml" rel="alternate" href="${ctxPath}/yvr/rss.xml"/>

  <link rel="icon" href="${cdnbase}${base}/rs/logo.png" type="image/x-icon"/>
  <link rel="stylesheet" type="text/css" href="${cdnbase}${base}/rs/logo/logo.css"/>
  
  <link rel="canonical" href="${conf["website.urlbase"]}" itemprop="url"/>

<!-- style -->
<style>
html { overflow-y: scroll; }
.autocomplete-suggestions { border: 1px solid #999; background: #AABBCC; overflow: auto; }
</style>
<link rel="stylesheet" type="text/css" href="${cdnbase}${base}/rs/libs/bootstrap/css/bootstrap.css?v=1"/>
<link rel="stylesheet" type="text/css" href="${cdnbase}${base}/rs/stylesheets/common.css?v=1"/>
<link rel="stylesheet" type="text/css" href="${cdnbase}${base}/rs/stylesheets/style.css?v=1"/>
<link rel="stylesheet" type="text/css" href="${cdnbase}${base}/rs/stylesheets/responsive.css?v=1"/>
<link rel="stylesheet" type="text/css" href="${cdnbase}${base}/rs/stylesheets/jquery.atwho.css?v=1"/>
<link rel="stylesheet" type="text/css" href="${base}/asserts/js/layer/skin/layer.css?v=1"/>
<link rel="stylesheet" type="text/css" href="${cdnbase}${base}/rs/libs/editor/editor.css?v=1"/>
<link rel="stylesheet" type="text/css" href="${cdnbase}${base}/rs/libs/webuploader/webuploader.css?v=1"/>
<link rel="stylesheet" type="text/css" href="${cdnbase}${base}/rs/libs/code-prettify/prettify.css?v=1"/>
<link rel="stylesheet" type="text/css" href="${cdnbase}${base}/rs/libs/font-awesome/font-awesome.css?v=1"/>
<link rel="stylesheet" type="text/css" href="${cdnbase}${base}/rs/css/introjs.css?v=1"/>
<link rel="stylesheet" type="text/css" href="${cdnbase}${base}/rs/css/cal-heatmap.css" />
<link rel="stylesheet" type="text/css" href="${base}/asserts/css/jquery.atwho.min.css" />

<!-- scripts -->
<script>
var ctxPath = "${ctxPath}";
var base = "${ctxPath}";
</script>
<script src="${cdnbase}${base}/rs/libs/jquery-2.1.4.min.js?v=1"></script>
<script src="${cdnbase}${base}/rs/js/vue.min.js?v=2" type="text/javascript"></script>
<script src="${cdnbase}${base}/rs/js/vue-resource.min.js" type="text/javascript"></script>

  <!--# if (null != obj.topic!) {  #-->
  <title itemprop='name'>${obj.topic.title} - ${conf['website.title']}</title>
  <!--# } else if (null != title!) { #-->
  <title itemprop='name'>${title, escape} - ${conf['website.title']}</title>
  <!--# } else if (null != obj.title!) { #-->
  <title itemprop='name'>${obj.title, escape} - ${conf['website.title']}</title>
  <!--# } else {  #-->
  <title itemprop='name'>${conf['website.title']}</title>
  <!--# }  #-->
  
  <!--# if (null != obj.topic! && null != obj.topic.tags! && 0 != obj.topic.tags.~size) {  #-->
  <meta name="Keywords" content="${obj.topic.tags, escape}"/>
  <!--#} else { #-->
  <meta name="Keywords" content="${conf['website.keywords']}"/>
  <!--#} #-->
  
  <!--# if (null != obj.topic!) {  #-->
  <meta name="Description" content="${submax(obj.topic.content, 50), escape}"/>
  <!--# } else {  #-->
  <meta name="Description" content="${conf['website.long_description']}"/>
  <!--# }  #-->
  
  <script type="application/ld+json">
    {
      "@context": "http://schema.org",
      "@type": "Organization",
      "url": "${conf["website.urlbase"]}",
      "logo": "${conf["website.urlbase"]}/rs/logo/logo.png"
    }
  </script>
  
  <meta content="_csrf" name="csrf-param"/>
  <meta content="${obj._csrf!}" name="csrf-token"/>
</head>
<body>
<!-- navbar -->
<div class='navbar'>
  <div class='navbar-inner'>
    <div class='container'>
      <a class='brand' href='${ctxPath}/yvr/list'>
        <div class="nutz-logo-bar">
    		<div class="nutz-logo">
        		<img src="${cdnbase}${base}/rs/logo/logo2.png" alt="网站logo"/>
        		<div class="logo-tail"></div>
    		</div>
    		<div class="nutz-txt">${conf["website.shortname"]}</div>
		</div>
      </a>

	  <div itemscope itemtype="http://schema.org/WebSite">
	    <meta itemprop="url" content="${conf["website.urlbase"]}"/>
        <form id='search_form' class='navbar-search' action="${ctxPath}/yvr/search" itemprop="potentialAction" itemscope itemtype="http://schema.org/SearchAction">
          <meta itemprop="target" content="${conf["website.urlbase"]}${ctxPath}/yvr/search?q={q}"/>
          <input type='text' id='q' name='q' class='search-query span3' value='' itemprop="query-input" required/>
        </form>
      </div>
      <ul class='nav pull-right'>
        <!--# if (null != obj.current_user!){  #-->
        <li>
        </li>
        <!--# }  #-->
        <li><a href='${conf["website.fornew.url"]}' title="就是nutzbook哦" target="_blank">新手入门</a></li>
        <li><a href='${ctxPath}/yvr/links/about.html' title="Answer to the Ultimate Question of Life, The Universe, and Everything">关于</a></li>
        <li><a href='${ctxPath}/pay/bc' title="查看打赏的清单">打赏</a></li>
        <li><a href='${ctxPath}/s/' title="我只是想贴段代码">短点</a></li>
        <li><a href='${ctxPath}/nutzdw/' title="新的下载入口">下载</a></li>
        <!--# if ( null != obj.current_user!) {  #-->
        <li><a href='${ctxPath}/yvr/u/logout' data-method="post" rel="nofollow" title="不要说拜拜">退出登陆</a></li>
        <!--# } else {  #-->
        <li><a href='#' onclick="f_signin();" title="推荐使用Github登陆">登录</a></li>
        <!--# }  #-->
      </ul>
      <a class="btn btn-navbar" id="responsive-sidebar-trigger">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </a>
    </div>
  </div>
</div>
<div id='main'>
  ${layoutContent}
</div>
<div id='backtotop'>回到顶部</div>
<div id='footer'>
  <div id='footer_main'>
    <div class="links">
      <a class='dark' href='${ctxPath}/yvr/rss'>RSS</a>
      |
      <a class='dark' href='https://github.com/wendal/nutz-book-project'>源码地址</a>
      | Power By 
      <a class='dark' href='https://github.com/nutzam/nutz'>Nutz</a>
      ,
      <a class='dark' href='http://www.qiniu.com/'><img src="${cdnbase}${base}/rs/images/qiniu-transparent.png" style="width: 10%; height: 10%"/></a>
      | 
      <a class="dark" href='https://cnodejs.org'>页面模板源自cnodejs</a>
      |
      <a title="查看备案信息" target="_blank" href="http://www.miibeian.gov.cn">${conf["website.beian"]}</a>
      |
      <a title="公司" target="_blank">${conf["website.ltd"]}</a>
    </div>

  </div>
</div>
<div id="sidebar-mask"></div>
<div id="signup_div" style="display: none">
	<form id='signup_form' style="padding: 30px 30px 30px 30px">
	<div class="input-group">
  		<span class="input-group-addon" id="basic-addon1">用户名</span>
  		<input name="username" type="text" class="form-control" placeholder="仅小写英文字母和数字,4到10位" aria-describedby="basic-addon1">
	</div>
	<div class="input-group">
  		<span class="input-group-addon" id="basic-addon1">密 码</span>
  		<input name="password" type="password" class="form-control" placeholder="包含大小写字母,数字,特殊符号" aria-describedby="basic-addon1">
	</div>
	<div class="input-group">
  		<span class="input-group-addon" id="basic-addon1">邮箱</span>
  		<input name="email" type="email" class="form-control" placeholder="用于发送验证邮件" aria-describedby="basic-addon1">
	</div>
	<button type="button" onclick="do_signup();" class="btn btn-primary">注册</button>
	<a href="${ctxPath}/yvr/u/oauth/github">推荐通过github登陆</a>
	</form>
</div>

<div id="signin_div" style="display: none">
	<form id='signin_form' style="padding: 30px 30px 30px 30px">
	<div class="input-group">
  		<span class="input-group-addon" id="basic-addon1">用户名</span>
  		<input name="username" type="text" class="form-control" placeholder="Username" aria-describedby="basic-addon1">
	</div>
	<div class="input-group">
  		<span class="input-group-addon" id="basic-addon1">密 码</span>
  		<input name="password" type="password" class="form-control" placeholder="Password" aria-describedby="basic-addon1">
	</div>
	<div class="input-group">
  		<span class="input-group-addon" id="basic-addon1">验证码</span>
  		<input name="captcha" type="text" class="form-control" placeholder="不区分大小写" aria-describedby="basic-addon1">
	</div>
	<div class="input-group">
		<img id="captcha_img" onclick="next_captcha();return false;"/>
	</div>
	<button type="button" onclick="do_signin();" class="btn btn-primary">登陆</button>
	<a href="${ctxPath}/yvr/u/oauth/github">推荐通过github登陆</a>
	</form>
</div>
<!--# if (null != conf["website.cnzz"]) { #-->
<div style="display: none;">
<script type="text/javascript">
//$(function() {
//var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_${conf["website.cnzz"]}'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s95.cnzz.com/z_stat.php%3Fid%3D${conf["website.cnzz"]}' type='text/javascript'%3E%3C/script%3E"));
//})();
</script>
</div>
<!--# }  #-->
<!--# if (null != conf["website.tongji"]) {  #-->
<script>
var _hmt = _hmt || [];
$(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?${conf["website.tongji"]}";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
});
</script>
<!--# }  #-->

<script src="${cdnbase}${base}/rs/libs/lodash.compat.js?v=1"></script>
<script src="${cdnbase}${base}/rs/libs/jquery-ujs.js?v=1"></script>
<script src="${cdnbase}${base}/rs/libs/bootstrap/js/bootstrap.js?v=1"></script>
<script src="${cdnbase}${base}/rs/libs/jquery.caret.js?v=1"></script>
<script src="${cdnbase}${base}/rs/libs/jquery.atwho.js?v=1"></script>
<script src="${cdnbase}${base}/rs/libs/qrcode.js?v=1"></script>
<script src="${cdnbase}${base}/rs/javascripts/main.js?v=1"></script>
<script src="${cdnbase}${base}/rs/javascripts/responsive.js?v=1"></script>
<script src="${base}/asserts/js/layer/layer.js?v=1"></script>
<script src="${cdnbase}${base}/rs/libs/jquery.pjax.js?v=1"></script>
<script src="${cdnbase}${base}/rs/js/jquery.zclip.js?v=0.2.2"></script>
<!-- jQuery edit in place plugin -->
<script src="${cdnbase}${base}/rs/libs/jquery.browser.js" type="text/javascript"></script>
<script src="${cdnbase}${base}/rs/libs/jquery.editinplace.js" type="text/javascript"></script>
<script src="${base}/asserts/js/base.js?v=3"></script>
<script src="${base}/asserts/js/user.js?v=2"></script>
<!--#if (null != obj.current_user!){ #-->
<script src="${cdnbase}${base}/rs/js/jquery.autocomplete.min.js" type="text/javascript"></script>
<script src="${cdnbase}${base}/rs/libs/webuploader/webuploader.withoutimage.js"></script>
<script src="${base}/pay/bc/js"></script>
<script>
var ws;
function ws_ping() {
	if (ws) {
		ws.send("{}");
	}
}
$(function(){
	if (!Notification) {
		return;
	}
	//if (console)
	//    console.info(Notification.permission);
	if (Notification.permission == "denied") {
		return;
	}
	if (Notification.permission !== "granted") {
		Notification.requestPermission();
	}
	if (Notification.permission !== "granted") {
		return;
	}
	try {
		var WS_URL = window.location.host+"${base}/websocket"
		if (location.protocol == 'http:') {
			ws = new WebSocket("ws://"+WS_URL);
		} else {
			ws = new WebSocket("wss://"+WS_URL);
		}
		
		ws.onmessage = function(event) {
		    var re = JSON.parse(event.data);
		    if (re.action == "notify") {
		    	<!--# if (obj.current_user! != null) { #-->
		    	if (re.byuser == ${obj.current_user.userId})
		    		return;
		    	<!--# } #-->
		    	re.options["icon"] = "${cdnbase}${base}/rs/logo.png";
			    var n = new Notification(re.data, re.options);
				n.onclick = function() {
					location.reload();
				};
		    } else if (re.action == "layer") {
		    	
		    }
		};
		ws.onopen = function(event) {
			ws.send(JSON.stringify({room:'${null == obj.topic.id! ? "home" : "topic:"+obj.topic.id}',"action":"join"}));
		};
		setInterval("ws_ping()", 25000);
	} catch (ex) {
		if (console)
		    console.info(ex);
	}
});
</script>
<!--#} #-->
</body>
</html>